<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const todos = [
        { id: 1, text: '吃饭', completed: false },
        { id: 2, text: '睡觉', completed: true },
        { id: 3, text: '打豆豆', completed: false },
        { id: 4, text: '写代码', completed: true },
      ]

      const res = todos.filter((todo) => !todo.completed)
      console.log(res)
    </script>
  </body>
</html>
